package com.ayf.payment.game.api.mapper.platform;

import com.ayf.payment.game.api.dto.criteria.CleanCriteria;
import com.ayf.payment.game.api.dto.criteria.OrderInfoCriteria;
import com.ayf.payment.game.api.dto.platform.MerchantCashOutBatchDTO;
import com.ayf.payment.game.api.dto.platform.MerchantCashOutCountDTO;
import com.ayf.payment.game.api.dto.platform.MerchantCashOutDTO;
import com.ayf.payment.game.api.dto.platform.MerchantSettleDayDTO;
import com.ayf.payment.game.api.dto.platform.criteria.MerchantCashOutCriteria;
import com.ayf.payment.game.api.dto.platform.criteria.MerchantCashOutPageCriteria;
import com.ayf.payment.game.api.entity.platform.MerchantCashOut;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface MerchantCashOutMapper extends Mapper<MerchantCashOut> {


    List<MerchantSettleDayDTO> selectMerchantSettleD1(@Param("selectCriteria") MerchantCashOutPageCriteria selectCriteria);

    List<MerchantSettleDayDTO> selectMerchantSettleD0(@Param("selectCriteria") MerchantCashOutPageCriteria selectCriteria);

    MerchantCashOutCountDTO countMerchantSettleDay(@Param("selectCriteria") MerchantCashOutCriteria selectCriteria);

    MerchantSettleDayDTO getMerchantSettleData(@Param("merchantId") Integer merchantId);

    MerchantSettleDayDTO getMerchantSettleDTO(@Param("tradeNumber") String tradeNumber);

    List<MerchantCashOutDTO> selectMerchantCashOutAll(@Param("selectCriteria") MerchantCashOutPageCriteria selectCriteria);

    List<MerchantCashOutDTO> selectMerchantCashOutAllNoPage(@Param("selectCriteria") MerchantCashOutCriteria selectCriteria);

    /**
     * 统计
     * @param selectCriteria
     * @return
     */
    MerchantCashOutCountDTO countMerchantCashOutAll(@Param("selectCriteria") MerchantCashOutCriteria selectCriteria);

    /**
     * 查询商户提现汇总信息
     *
     * @param cri
     * @return
     */
    @MapKey("merchant_id")
    Map<Integer, Map<String, Object>> selectSumWithdrawal(@Param("cri") OrderInfoCriteria cri);


    /**
     * 清理结算信息
     *
     * @param clean
     * @return
     */
    int cleanSettle(@Param("clean") CleanCriteria clean);

    /**
     * 根据批次号得到列表
     * @param selectCriteria
     * @return
     */
    List<MerchantCashOutDTO> getCashOutByBatchList(@Param("criteria")MerchantCashOutCriteria criteria);


    /**
     * 查询批次列表
     * @param selectCriteria
     * @return
     */
    List<MerchantCashOutBatchDTO> selectBatchOrderAll(@Param("criteria")MerchantCashOutPageCriteria criteria);

}